package cn.samler.diandi.api.controller;

import cn.samler.diandi.api.entity.UserResume;
import cn.samler.diandi.api.model.io.Response;
import cn.samler.diandi.api.service.ResumeService;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("resume")
public class ResumeController {
    private final ResumeService resumeService;

    public ResumeController(ResumeService resumeService) {
        this.resumeService = resumeService;
    }

    /**
     * 查看个人资料
     *
     * @param uid user id
     * @return Response
     */
    @GetMapping("detail/{id}")
    public Response detailResume(@PathVariable("id") Integer uid) {
        return resumeService.detail(uid);
    }

    /**
     * 更新个人资料
     *
     * @param form 表单
     * @return Response
     */
    @PostMapping("update")
    public Response update(@RequestBody UserResume form) {
        return resumeService.update(form);
    }

}
